<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
	<head>
		<title>.:: SEVIN ::.</title>
		<meta name="keywords" content="">
		<meta name="description" content="">
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		
		
		<!-- Arquivos CSS	-->	
		
		<link rel="stylesheet" href="<?php echo $this->styleUrl; ?>/geral.css" 	type="text/css"/>	
		<link rel="stylesheet" href="<?php echo $this->styleUrl; ?>/sevin.css" 	type="text/css"/>	
		<link rel="stylesheet" href="<?php echo $this->styleUrl; ?>/view.css" 		type="text/css">   
		<link rel="stylesheet" href="<?php echo $this->styleUrl; ?>/simpleAutoComplete.css" type="text/css" />	
    	<link rel="stylesheet" href="<?php echo $this->scriptUrl; ?>/jquery-ui-1.8.16.custom/css/custom-theme/jquery-ui-1.8.16.custom.css" type="text/css"/>
		<link rel="stylesheet" href="<?php echo $this->scriptUrl; ?>/jquery.tablesorter/blue/style.css" type="text/css"/>			
	 	
		<style type="text/css">
			/*jQuery page css - incio*/
			body{ font: 62.5% "Trebuchet MS", sans-serif; margin: 50px;}
			.demoHeaders { margin-top: 2em; }
			#dialog_link {padding: .4em 1em .4em 20px;text-decoration: none;position: relative;}
			#dialog_link span.ui-icon {margin: 0 5px 0 0;position: absolute;left: .2em;top: 50%;margin-top: -8px;}
			ul#icons {margin: 0; padding: 0;}
			ul#icons li {margin: 2px; position: relative; padding: 4px 0; cursor: pointer; float: left;  list-style: none;}
			ul#icons span.ui-icon {float: left; margin: 0 4px;}
			/*jQuery page css - fim*/
			/*CSS - formToWizard - inicio*/
			.grid_button { border: 0; text-decoration: none; background: none; }
	        legend { font-size:18px; margin:0px; padding:10px 0px; color:#b0232a; font-weight:bold;}
	        .prev, .next, .save { background-color:#b0232a; padding:5px 10px; color:#fff; text-decoration:none; border: 0;}
	        .prev:hover, .next:hover, .save:hover { background-color:#000; text-decoration:none;}
	        .prev { float:left;}
	        .next { margin-right:-280px; float:right;}
	        fieldset { border:none; width:320px;}
	        #steps { list-style:none; width:100%; overflow:hidden; margin:0px; padding:0px;}
	        #steps li {font-size:24px; float:left; padding:10px; color:#b0b1b3;}
	        #steps li span {font-size:11px; display:block;}
	        #steps li.current { color:#000;}
	        #makeWizard { background-color:#b0232a; color:#fff; padding:5px 10px; text-decoration:none; font-size:18px;}
	        #makeWizard:hover { background-color:#000;}			
			/*CSS - formToWizard - fim*/
			
		</style>			 				
		<!-- Scripts -->
		
		<script language="JavaScript" type="text/javascript" src="<?php echo $this->scriptUrl; ?>/masks.js"></script>
		<script language="JavaScript" type="text/javascript" src="<?php echo $this->scriptUrl; ?>/util.js"></script>
	    <script language="JavaScript" type="text/javascript" src="<?php echo $this->scriptUrl; ?>/overlib_mini.js"></script>
		<script language="JavaScript" type="text/javascript" src="<?php echo $this->scriptUrl; ?>/conf_overlib.js"></script>
		<script language="JavaScript" type="text/javascript" src="<?php echo $this->scriptUrl; ?>/view.js"></script>
				

    	<!-- Script de validação das telas de formulário -->
		<?php if($this->validacao!=null){ ?>
		<script language="JavaScript" type="text/javascript" src="<?php echo $this->scriptUrl.'/'.$this->validacao.'.js';?>"></script>
		<?php } ?>
    	
    	<!-- Os scripts JQUERY devem estar nesta ordem -->
    	<script type="text/javascript" src="<?php echo $this->scriptUrl; ?>/jquery-ui-1.8.16.custom/js/jquery-1.6.2.min.js"></script>
		<script type="text/javascript" src="<?php echo $this->scriptUrl; ?>/jquery-ui-1.8.16.custom/js/jquery.js"></script>
		<script type="text/javascript" src="<?php echo $this->scriptUrl; ?>/jquery-ui-1.8.16.custom/js/jquery-ui-1.8.16.custom.min.js"></script>	
		<script type="text/javascript" src="<?php echo $this->scriptUrl; ?>/jquery-ui-1.8.16.custom/development-bundle/ui/i18n/jquery.ui.datepicker-pt-BR.js"></script>	
		
		<script type="text/javascript" src="<?php echo $this->scriptUrl; ?>/jquery.tablesorter/jquery.tablesorter.js"></script>
		
		<!-- Script para transformar o formulário em um formulário passo a passo -->
		<?php if ($this->addSteps){    
			echo ' <script type="text/javascript" src="'.$this->scriptUrl.'/formToWizard.js"></script>
		    		<script type="text/javascript">
		        		$(document).ready(function(){
		            		$("#frm_'.$this->validacao.'").formToWizard({ submitButton: \'SaveAccount\', currentStep: \''.$this->currentStep.'\' })
		        		});
		    		</script>';
		}?>	
		
				
		<script type="text/javascript">
			function carregando(on_off){
				var iconCarregando = $('<img src="/images/mini_carregamento.gif" class="icon"/> <span class="destaque">Carregando. Por favor aguarde...</span>');
				if (on_off=="on")
					$('#carregando').html(iconCarregando);
				else
					$('#carregando').remove();
			}
			function confirmar_remocao(){
				return (confirm ("Confirma a exclusão do registro?"));
			}		
			
			function habilitar_desabilitar(id_div){
			    if ($("#"+id_div).is(":hidden")){  
			        $("#"+id_div).slideDown('normal');  
			    }  
			    else{  
			        $("#"+id_div).slideUp('normal');  
			    }  	
			}	
			function limparFormulario(divName, buttonName){
				$("#"+divName+" input").each(function(){
					$(this).val('');
				});
				$("#"+divName+" select").each(function(){
					$(this).val('');
				});	
				if (buttonName!=null){
					if ($('#'+buttonName).text().toUpperCase()=='SALVAR')
						$('#'+buttonName).html('<span class="ui-button-text">Adicionar</span>');
				}
			}
			function erroRequisicao(xhr, er){
				alert("Lamento! Ocorreu um erro. Tente mais tarde.");
			}
			function carregarElementosDependentes(id_elemento_pai, nm_elemento_filho, classe_elemento_pai, pesquisa){
				$.ajax(
						{
						  url: "/index.php/model/lista",
						  data: {id:id_elemento_pai, class:classe_elemento_pai, styleList:'select', pesquisar: pesquisa},
						  dataType: 'html',
						  type: "GET",
						  timeout: 5000,
						  beforeSend: function() {
							  carregando("on");
						  },
						  complete: function(){
							  carregando("off");
						  },
						  success: function(data, textStatus) {
							  $('#'+nm_elemento_filho).empty();
							  $('#'+nm_elemento_filho).html(data);
						  },
						  error: function(xhr, er) {
							  erroRequisicao(xhr, er);
						  }
						}
					);	
			}											
		$(function(){
				//Barra de ferramentas
				$(".icon-home" ).button({ icons: {primary: "ui-icon-home"},
				  						  text: false
				});			
				$(".icon-manual" ).button({ icons: {primary: "ui-icon-lightbulb"},
					  					    text: true
				});
				$(".icon-logout" ).button({ icons: {primary: "ui-icon-power"},
					                        text: false
				});					
				$(".icon-add" ).button({ icons: {primary: "ui-icon-plusthick"},
				                            text: false
				});	
				$(".icon-consulta" ).button({ icons: {primary: "ui-icon-search"},
                                            text: false
				});					
				$(".icon-menu-consulta" ).button({ icons: {primary: "ui-icon-search"},
                    text: true
				});
				$(".icon-menu-add" ).button({ icons: {primary: "ui-icon-plusthick"},
                    text: true
				});							
				// Accordion
				$("#accordion").accordion({ header: "h3" });
				// Tabs
				$('#tabs').tabs({ 
						select: function(event, ui){ 
							$('#idCurrentTab').val($( "#tabs" ).tabs( "option", "selected" )); //Indica qual TAB está selecionada
						}
						<?php if ($this->disableTabs){ echo ', disabled: ['.implode(', ', $this->disableTabs).']';}?>
						<?php if ($this->currentTab) { echo ', selected: '.$this->currentTab;}?> 
				});
				
				// Dialog
				$( "#dialog-detalhe").dialog({
					autoOpen: false,
					modal: true,
					height: 320,
					width: 600,
					buttons: {
						"Fechar": function() {
							$( this ).dialog( "close" );
						}
					},
					close: function() {
						allFields.val( "" ).removeClass( "ui-state-error" );
					}
					
				});
					
				$( "#dialog-form" ).dialog({
					autoOpen: false,
					height: 300,
					width: 350,
					modal: true,
					buttons: {
						"Create an account": function() {
							var bValid = true;
							allFields.removeClass( "ui-state-error" );

							bValid = bValid && checkLength( name, "username", 3, 16 );
							bValid = bValid && checkLength( email, "email", 6, 80 );
							bValid = bValid && checkLength( password, "password", 5, 16 );

							bValid = bValid && checkRegexp( name, /^[a-z]([0-9a-z_])+$/i, "Username may consist of a-z, 0-9, underscores, begin with a letter." );
							// From jquery.validate.js (by joern), contributed by Scott Gonzalez: http://projects.scottsplayground.com/email_address_validation/
							bValid = bValid && checkRegexp( email, /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i, "eg. ui@jquery.com" );
							bValid = bValid && checkRegexp( password, /^([0-9a-zA-Z])+$/, "Password field only allow : a-z 0-9" );

							if ( bValid ) {
								$( "#users tbody" ).append( "<tr>" +
									"<td>" + name.val() + "</td>" + 
									"<td>" + email.val() + "</td>" + 
									"<td>" + password.val() + "</td>" +
								"</tr>" ); 
								$( this ).dialog( "close" );
							}
						},
						Cancel: function() {
							$( this ).dialog( "close" );
						}
					},
					close: function() {
						allFields.val( "" ).removeClass( "ui-state-error" );
					}
				});
				////////////////

				
				var ret = false;		
				$( "#dialog-sair" ).dialog({
					autoOpen: false,
					show: "blind",
					hide: "explode",
					modal: true,
					height: 100,
					width: 200,
					buttons: {
						"Sim": function() {
							$( this ).dialog( "close" );
							window.location.href = $('#logout').attr('href');
						},
						"Não": function() {
							$( this ).dialog( "close" );
						}
					}					
					
				});

				$( "#logout" ).click(function() {
						$( "#dialog-sair" ).dialog( "open" );
						return false;
					});
				
				// Datepicker
				$(".dates").each(function(i){
					var dataIni = "ini"+i;
					var dataFim = "fim"+i;
					var dates = $( "#"+dataIni+", "+"#"+dataFim ).datepicker({
						defaultDate: "+1w",
						numberOfMonths: 1,
						showAnim: "slide",
						onSelect: function( selectedDate ) {
							var option = this.id == dataIni ? "minDate" : "maxDate",
								instance = $( this ).data( "datepicker" ),
								date = $.datepicker.parseDate(
									instance.settings.dateFormat ||
									$.datepicker._defaults.dateFormat,
									selectedDate, instance.settings );
							dates.not( this ).datepicker( "option", option, date );
						}
					});
				});	
				// Slider
				$('#slider').slider({
					range: true,
					values: [17, 67]
				});
				// Progressbar
				$("#progressbar").progressbar({
					value: 20 
				});

				$("input:submit, button").button();
				//$(".trash").button({ icons: {primary:'ui-icon-trash'}, text: false  });
				//$( "a", ".demo" ).click(function() { return false; });						     		
			});		    			
		</script>


	</head>
